Flash Article

Macromedia XML News Aggregator Web Service Sample Application and Source File

Mike Chambers

Mike Chambers

Community Manager
Macromedia

The Macromedia XML News Aggregator (MXNA) Web Service Application is a sample application built in Flash MX Professional 2004. It uses the MXNA web service API to provide a simple interface for quickly viewing and reading weblog feeds and posts aggregated by the MXNA. Here is the application in action:

Requirements

Macromedia Flash MX Professional 2004


Sample Files



MXNA ActionScript 2.0 Library

The application is built using ActionScript 2.0 and the web services classes included with Flash MX Professional 2004. I’ve completely commented the source code for the application so you can easily dissect and learn from the application.

Here is some information to prepare you to work with the code.

Using the Web Services Classes

The application requires the web services classes included with Flash MX Professional 2004. To use these classes, you must manually include them within your library. The MXNA application’s library already contains the web services classes, however, for future reference, here are the steps to place it within your library:

  1. From within Flash MX Professional 2004 open Window > Other Panels > Common Libraries > Classes
  2. Drag the WebServicesClasses symbol from the library onto the Stage.
  3. Delete the WebServicesClasses symbol.

This places the class in your library, making it available for use at runtime.

Finding the ActionScript

When you open the application FLA file, you will notice that there is no ActionScript included within the FLA. All of the ActionScript for the application is held in external classes that are linked to symbols within the library.

To view the linkage and class for each symbol:

  1. Open the library for the application (Window > Library).
  2. Open the MXNAApp folder within the library. This contains all of the class symbols of the application.
  3. Right-click the MXNAApp\MXNAAppController symbol. This is the symbol that represents the controller for the application.
Linkage Properties dialog box for MXNAAppController symbol

Figure 1. Linkage Properties dialog box for MXNAAppController symbol

Notice the section titled AS 2.0 Class, which has a value of com.macromedia.mxna.app.MXNAAppController. This specifies that the symbol is associated with the specified class. (If you look in your file system, you can find the class in the com/macromedia/mxna.app/MXNAAppController.as file.)

Class layout in the file system

Figure 2. Class layout in the file system

As soon as the Flash Player loads the MXNAAppController symbol, it will also automatically load the MXNAAppController class and associate it with that symbol.

Additional Resources


About the author

Mike Chambers has been creating applications utilizing primarily Macromedia Flash, Generator and Java for the past three years. He also has experience working with ASP, JSP, PHP and ColdFusion. Recently he has been focusing on server integration with Macromedia Flash and developing Macromedia Flash applications for devices. He is co-author of Flash Enabled: Flash Design and Development for Devices and Generator and Flash Demystified.

Mike received his Masters in International Economics and European Studies from the John Hopkins School of Advanced International Studies (SAIS) in 1998.